#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 505;

int n, m;
char s[N][N];
int c[N][2][128];
int dp[N][128][128];
pii pre[N][128][128];
void out(int i, char a, char b) {
  if (i != 1) {
    char x = pre[i][a][b].first, y = pre[i][a][b].second;
    out(i - 1, x, y);
  }
  rep(j, 1, m) {
    if (j & 1)
      cout << a;
    else
      cout << b;
  }
  cout << endl;
}
int cost(int i, char a, int odd) {
  int res = 0;
  rep(j, 1, m) {
    if ((j & 1) == odd && s[i][j] != a) res++;
  }
  return res;
}
void solve() {
  cin >> n >> m;
  rep(i, 1, n) rep(j, 1, m) cin >> s[i][j];
  rep(i, 1, n) rep(odd, 0, 1) rep(ch, 'a', 'z') c[i][odd][ch] =
      cost(i, ch, odd);
  memset(dp, 0x3f, sizeof(dp));
  rep(i, 'a', 'z') rep(j, 'a', 'z') {
    if (i == j) continue;
    dp[1][i][j] = c[1][1][i] + c[1][0][j];
  }
  rep(i, 2, n) rep(a, 'a', 'z') rep(b, 'a', 'z') {
    if (a == b) continue;
    int now = c[i][1][a] + c[i][0][b];
    rep(u, 'a', 'z') rep(v, 'a', 'z') {
      if (u == v || u == a || v == b) continue;
      if (dp[i][a][b] > dp[i - 1][u][v] + now) {
        pre[i][a][b] = pii(u, v);
        dp[i][a][b] = dp[i - 1][u][v] + now;
      }
    }
  }
  int ans = 1e9;
  char x, y;
  rep(i, 'a', 'z') rep(j, 'a', 'z') {
    if (i == j) continue;
    if (ans > dp[n][i][j]) ans = dp[n][i][j], x = i, y = j;
  }
  cout << ans << endl;
  out(n, x, y);
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}